fix: suppress JSONDtypeWarning in Anywidget mode and clean up progress output#2441
Merged
fix: suppress JSONDtypeWarning in Anywidget mode and clean up progress output#2441
Conversation
sycai
reviewed
Feb 6, 2026
Contributor
sycai
left a comment
There was a problem hiding this comment.
Would it be possible to add a test, assuming that it would not be forbiddingly hard?
bigframes/formatting_helpers.py
Outdated
| elif progress_bar == "terminal": | ||
| if isinstance(event, bigframes.core.events.ExecutionStarted): | ||
| print("Starting execution.") | ||
| pass |
Contributor
There was a problem hiding this comment.
nit: let's add a comment on why no action is needed.
Contributor
Author
There was a problem hiding this comment.
Done. I have added a comment explaining that we are skipping it to reduce noise in the terminal.
bigframes/display/anywidget.py
Outdated
Comment on lines
118
to
125
| with warnings.catch_warnings(): | ||
| warnings.simplefilter("ignore", bigframes.exceptions.JSONDtypeWarning) | ||
| warnings.simplefilter("ignore", category=FutureWarning) | ||
| self.orderable_columns = [ | ||
| str(col_name) | ||
| for col_name, dtype in dataframe.dtypes.items() | ||
| if dtypes.is_orderable(dtype) | ||
| ] |
Contributor
There was a problem hiding this comment.
(No action needed) It seems this constructor is getting way more complicated than necessary. We may need a refactoring some time in the future. Given the tight timeline we have at the moment, this change can be merged as-is in this PR
Contributor
Author
There was a problem hiding this comment.
This chunk of code has been refactored for better readability.
…-anywidget-disable-warning # Conflicts: # bigframes/display/anywidget.py # bigframes/formatting_helpers.py
# Conflicts: # tests/system/small/test_series.py
sycai
approved these changes
Feb 7, 2026
# Conflicts: # bigframes/formatting_helpers.py
sycai
approved these changes
Feb 7, 2026
shuoweil
added a commit
that referenced
this pull request
Feb 7, 2026
PR created by the Librarian CLI to initialize a release. Merging this PR will auto trigger a release. Librarian Version: v0.7.0 Language Image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:e7cc6823efb073a8a26e7cefdd869f12ec228abfbd2a44aa9a7eacc284023677 <details><summary>bigframes: 2.35.0</summary> ## [2.35.0](v2.34.0...v2.35.0) (2026-02-07) ### Features * Add bigframes.pandas.col with basic operators (#2405) ([1274167](12741677)) * remove redundant "started." messages from progress output (#2440) ([2017cc2](2017cc2f)) * add bigframe.bigquery.load_data function (#2426) ([4b0f13b](4b0f13b2)) * Disable progress bars in Anywidget mode (#2444) ([4e2689a](4e2689a1)) * add bigquery.ai.generate_text function (#2433) ([5bd0029](5bd0029a)) * Disable progress bars in Anywidget mode to reduce notebook clutter (#2437) ([853240d](853240da)) * Add a bigframes cell magic for ipython (#2395) ([e6de52d](e6de52de)) * add `bigframes.bigquery.ai.generate_embedding` (#2343) ([e91536c](e91536c8)) ### Bug Fixes * always display the results in the `%%bqsql` cell magics output (#2439) ([2d973b5](2d973b54)) * exlcude gcsfs 2026.2.0 (#2445) ([311de31](311de31e)) * suppress JSONDtypeWarning in Anywidget mode and clean up progress output (#2441) ([e0d185a](e0d185ad)) ### Documentation * fix cast method shown on public docs (#2436) ([ad0f33c](ad0f33c6)) </details>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR improves the user experience when using the interactive anywidget display mode (bpd.options.display.repr_mode = "anywidget") by reducing console noise.
Verified at:
vs code notebook: screen/ACCJRLwyThciMk8
colab notebook: screen/BhNxzpvckYg9Wp8
Fixes #<482120359> 🦕